home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15258 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: status.gen.nz!usenet
  2. From: Alan Howard <duck@central.co.nz>
  3. Newsgroups: comp.lang.c
  4. Subject: Parsing filenames
  5. Date: Thu, 18 Apr 1996 16:27:57 -0700
  6. Organization: RNZAF
  7. Message-ID: <3176CFFD.6723@central.co.nz>
  8. NNTP-Posting-Host: duck.central.co.nz
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win16; I)
  13.  
  14. I am copying shareware files from a CD to a HDD to compile a CD-R of my 
  15. own full of back-up info.  The files in question are ex Amiga 1200 an all 
  16. have long filenames full of illegal spaces (0x20) and asterisks...
  17. MS-Dos truncates the long filenames into 8.3 but leaves duplicates in 
  18. each dir ie, 'robots in the park' and 'robots in the garden' both convert 
  19. to 'robots i'.
  20. I know that the file names in each dir are stored in the dir entry on the 
  21. HDD (used nortons utilities v 8 to look) and am considering coding a 
  22. stub to do something like...
  23.  
  24. 1.    Identify the next file to be transferred from CD to HDD.
  25. 2.    Open the illegally named file.
  26. 3.    Fix filename, swap 0x20's for u'scores etc, rename dups...
  27. 4.    Create new file on HDD using new name.
  28. 5.    Transfer data from CD to HDD.
  29.  
  30. Problem is that dos (hence Turbo C++) recognises the file to be opened 
  31. but the spaces vanish when it tries to open the file ie 'one bar' becomes 
  32. 'onebar' and the open fails, in Dos and TC++.
  33.  
  34. Can anyone help me get around this problem.  How do I open an illegally 
  35. named file and then transfer the data associated with it from A to B???
  36. How are the dir entries formatted, How can I find a specific entry, look 
  37. in it, find the beginning cluster for an arbitrary file, convert this 
  38. info to C function calls and shift the data??????
  39.  
  40. I'm stuffed. Please Help
  41.  
  42. Thanks in advance, Alan...
  43.